#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from PageObjects.ACToys.ACToysBasePage import ACToysBasePage
from Utils.Element import Element
from Utils.PropertiesParsor import ParsePageProperty

parse_string = ParsePageProperty().parse_string
parse_list = ParsePageProperty().parse_list
parse_locator = ParsePageProperty().parse_locator


class ACToysSearcherPage(ACToysBasePage):

    @staticmethod
    def parse_url():
        return parse_string('ACToys.SearcherPage.url')

    @staticmethod
    def parse_target_search_content_list():
        return parse_list('ACToys.SearcherPage.target_search_content_list')

    def search_textbox(self):
        return Element(self.driver, parse_locator('ACToys.SearcherPage.search_textbox'))

    def search_button(self):
        return Element(self.driver, parse_locator('ACToys.SearcherPage.search_button'))

    def search_results_links(self):
        return Element(self.driver, parse_locator('ACToys.SearcherPage.search_results_links')).elements()
